home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / qbbs / multisb.zip / N1.BAT < prev    next >
DOS Batch File  |  1992-02-16  |  8KB  |  343 lines

  1. @ECHO OFF
  2.  
  3. REM Check if Frontdoor is allready running...
  4.  
  5.   if exist i:\fd\fd1.up goto FD_UP
  6.  
  7. Echo Clearing environemental variables...
  8.  
  9. REM Clear some unused variables for this window
  10.  
  11.   set SHEZEX=
  12.   set SHEZWORK=
  13.   set LIST=
  14.  
  15. Echo Setting new variables...
  16.  
  17. REM Set some new variables specific to this window
  18. REM Remember to use different DSZ log for each node, TCNODE is for Chatman
  19. REM and XRS, LOCK is used in Doors.bat, BAUD is for this batch file to reload
  20. REM BBS for guest users to sign up.
  21.  
  22.   set FD=C:\FD\FD1
  23.   set DSZLOG=I:\SBBS\DSZLOG.N1
  24.   set DSZPORT=1
  25.   set SUPER=Y
  26.   set TCNODE=1
  27.   set LOCK=38400
  28.   set BAUD=0
  29.  
  30. REM Load DnAnsi and use DvCommand to turn off DV window border
  31.  
  32.   ansi
  33.   dc frame off /q
  34.  
  35. REM The Main Loop...
  36.  
  37. :FRT_DOOR
  38.  
  39. REM Use ANSI to set DOS colors
  40.  
  41.   echo 
  42.  
  43. REM Set Baud back to 0, make sure our semaphore to say FD 1 is running is still
  44. REM there, delete downloa1.* ( created by MTS ) delete Sbbs semaphore
  45. REM if XRS packets are in XRS directory, go run Imail to toss
  46.  
  47.   set BAUD=0
  48.   if not exist i:\fd\fd1.up rem > i:\fd\fd1.up
  49.   if exist e:\uploads\downloa1.* del e:\uploads\downloa1.* > nul
  50.   if exist i:\sbbs\n1.up del i:\sbbs\n1.up > nul
  51.   if exist c:\sbbs\n1\xrs\*.pkt goto XRSMAIL
  52.  
  53. REM Fossil command to recapture int 14h
  54.  
  55.   %FOS%
  56.  
  57. REM Change directories to Sbbs, run sbbsutil to change node status since we are
  58. REM using FD to answer phone.
  59.  
  60.   c:
  61.   cd\sbbs
  62.   sbbsutil nodestatus 1 2
  63.   cd\fd\fd1
  64.   cls
  65.  
  66. REM Bring up Frontdoor, after exit do ????, notice check and delete DOORCFG.BBS
  67. REM from node 1 directory. CONFIG.EXE creates this wherever you run it but it's
  68. REM only needed in main directory
  69.  
  70.   fd
  71.   if errorlevel 255 goto FRT_DOOR
  72.   if exist c:\sbbs\n1\doorcfg.bbs del c:\sbbs\n1\doorcfg.bbs > nul
  73.  
  74. REM BBS caller ???? create semaphore to say n1 is up
  75.  
  76.   rem > i:\sbbs\n1.up
  77.   if errorlevel 214 goto 14400_baud
  78.   if errorlevel 196 goto 9600_baud
  79.   if errorlevel 148 goto 4800_baud
  80.   if errorlevel 124 goto 2400_baud
  81.   if errorlevel 112 goto 1200_baud
  82.   if errorlevel 103 goto 300_baud
  83.   if errorlevel 100 goto LOCAL
  84.  
  85. REM No BBS caller, delete semaphore and do some mail stuff
  86.  
  87.   del i:\sbbs\n1.up > nul
  88.   if errorlevel  95 goto NET_ECHO
  89.   if errorlevel  94 goto ECHO_ONLY
  90.   if errorlevel  93 goto NET_ONLY
  91.   if errorlevel  90 goto UNPACK_MAIL
  92.   if errorlevel  60 goto SDN
  93.   if errorlevel  55 goto WEEKLY
  94.   if errorlevel  50 goto COMMO
  95.   if errorlevel  45 goto MIDNIGHT
  96.   if errorlevel  40 goto NIGHTLY
  97.   if errorlevel  10 goto QUIT
  98.   if errorlevel   5 goto MODEM_INIT
  99.  
  100. REM Unknown errorlevel, go back
  101.  
  102.   goto FRT_DOOR
  103.  
  104. REM The next few are to bring BBS up at certain baud rate, note that the baud
  105. REM rate sent with -b is just used for calculating file transfers. Sbbs checks
  106. REM DTR/CTS on modem to send stuff and doesn't seem to use this baud rate for
  107. REM anything else
  108. REM command line help
  109. REM -n<node>
  110. REM -* Do not use EMS for overlay
  111. REM -o Overlay buffer for conventional memory
  112. REM -b<baud>
  113. REM -e<errorlevel> exit with ? errorlevel after caller
  114. REM
  115. REM goto BBS_ERRLVL after exit
  116.  
  117. :14400_baud
  118.   set BAUD=14400
  119.   cd\sbbs\n1
  120.   bbs -n1 -* -o100000 -b14400 -e0
  121.   goto BBS_ERRLVL
  122.  
  123. :9600_baud
  124.   set BAUD=9600
  125.   cd\sbbs\n1
  126.   bbs -n1 -* -o100000 -b9600 -e0
  127.   goto BBS_ERRLVL
  128.  
  129. :4800_baud
  130.   set BAUD=4800
  131.   cd\sbbs\n1
  132.   bbs -n1 -* -o100000 -b4800 -e0
  133.   goto BBS_ERRLVL
  134.  
  135. :2400_baud
  136.   set BAUD=2400
  137.   cd\sbbs\n1
  138.   bbs -n1 -* -o100000 -b2400 -e0
  139.   goto BBS_ERRLVL
  140.  
  141. :1200_baud
  142.   set BAUD=1200
  143.   cd\sbbs\n1
  144.   bbs -n1 -* -o100000 -b1200 -e0
  145.   goto BBS_ERRLVL
  146.  
  147. :300_baud
  148.   set BAUD=300
  149.   cd\sbbs\n1
  150.   bbs -n1 -* -o100000 -b300 -e0
  151.   goto BBS_ERRLVL
  152.  
  153. :LOCAL
  154.   set BAUD=0
  155.   cd\sbbs\n1
  156.   bbs -n1 -* -o100000 -l -e0
  157.   goto BBS_ERRLVL
  158.  
  159. :RELOAD
  160.   cd\sbbs\n1
  161.   bbs -n1 -* -o100000 -b%BAUD% -e0
  162.   goto BBS_ERRLVL
  163.  
  164. :RET_BBS
  165.   if exist c:\sbbs\n1\doorcfg.bbs del c:\sbbs\n1\doorcfg.bbs > nul
  166.   c:
  167.   cd\sbbs\n1
  168.   bbs -n1 -* -o100000 -R -e0
  169.  
  170. :BBS_ERRLVL
  171.   if errorlevel 80 goto RELOAD
  172.   if errorlevel 70 goto RET_BBS
  173.   if errorlevel 60 goto DOSDOOR
  174.   if errorlevel 50 goto LIST
  175.   if exist i:\sbbs\n1.up del i:\sbbs\n1.up
  176.   if errorlevel  5 goto NET_ECHO
  177.   if errorlevel  4 goto ECHO_ONLY
  178.   if errorlevel  3 goto NET_ONLY
  179.   if errorlevel  2 goto QUIT
  180.  
  181. :LOOPBACK
  182.  
  183. REM Comes back here after caller exit and or MAIL gets processed
  184.  
  185.   if %BAUD%==0 goto FRT_DOOR
  186.   dc beep 200,1 0,2 /r=2 /q
  187.   if exist sbbsswap.$$$ del sbbsswap.$$$ > nul
  188.  
  189. REM if node 2 is up don't do the rest, non-multiline stuff
  190.  
  191.   if exist i:\sbbs\n?.up goto FRT_DOOR
  192.   cd\sbbs
  193.   multiscn c:\sbbs\text\picture.ans
  194.   last 5 c:\sbbs\scallers.bbs
  195.   if not exist pfiles.bbs goto FRT_DOOR
  196.   imthings post /fpfiles.bbs /b18 /wBob_Henderson /sPrivate_Upload
  197.   del pfiles.bbs > nul
  198.   goto FRT_DOOR
  199.  
  200. :DOSDOOR
  201.   cd\sbbs\n1
  202.   QKDOOR QBBS GAP
  203.   DOORWAY.EXE SYS /i:c:\ext\doorpass /f /o:t /v:d^U /K:0 /C:DOS
  204.   goto RET_BBS
  205.  
  206. :LIST
  207.   cd\sbbs\n1
  208.   QKDOOR QBBS GAP
  209.   DOORWAY.EXE SYS /i:c:\ext\doorpass /f /o:t /v:d^U /p:c:\xtg\ld.com
  210.   goto RET_BBS
  211.  
  212. :SDN
  213.   fdrc poll 1:396/15 crash imm kill
  214.   goto FRT_DOOR
  215.  
  216. :COMMO
  217.   if exist i:\fd\fd2.up goto COMMO1
  218.   cd\commo
  219.   if not exist gedown.now goto FRT_DOOR
  220.   del gedown.now
  221.   cd\dv
  222.   dc open c1-pif.dvp
  223.   goto FRT_DOOR
  224.  
  225. :COMMO1
  226.   rem > c:\fd\fd2\fdexit.50
  227.   goto FRT_DOOR
  228.  
  229. :MIDNIGHT
  230.  
  231. REM the midnight event, to understand this you will have to look at both batch
  232. REM files. The program WAIT! waits for a file to disappear or apprear?
  233. REM Anyways, always check for other nodes before doing anything like packing
  234. REM message base or running door events or ??? bad stuff
  235.  
  236.   if exist i:\sbbs\n?.up goto MIDNIGHT1
  237.   if not exist i:\fd\fd2.up call midnight.bat
  238.   if not exist i:\fd\fd2.up goto FRT_DOOR
  239.   rem > c:\fd\fd2\fdexit.96
  240.   wait! t i:\sbbs\fdevent.ok
  241.   del i:\sbbs\fdevent.ok > nul
  242.   call midnight.bat
  243.   rem > i:\sbbs\fdevent.ovr
  244.   goto FRT_DOOR
  245.  
  246. :MIDNIGHT1
  247.   rem > c:\fd\fd2\fdexit.45
  248.   goto FRT_DOOR
  249.  
  250. :NIGHTLY
  251.   if exist i:\sbbs\n?.up goto NIGHTLY1
  252.   if not exist i:\fd\fd2.up call nightly.bat
  253.   if not exist i:\fd\fd2.up goto FRT_DOOR
  254.   rem > c:\fd\fd2\fdexit.96
  255.   wait! t i:\sbbs\fdevent.ok
  256.   del i:\sbbs\fdevent.ok > nul
  257.   call nightly.bat
  258.   rem > i:\sbbs\fdevent.ovr
  259.   goto FRT_DOOR
  260.  
  261. :NIGHTLY1
  262.   rem > c:\fd\fd2\fdexit.40
  263.   goto FRT_DOOR
  264.  
  265. :WEEKLY
  266.   if exist i:\sbbs\n?.up goto WEEKLY1
  267.   if not exist i:\fd\fd2.up call weekly.bat
  268.   if not exist i:\fd\fd2.up goto FRT_DOOR
  269.   rem > c:\fd\fd2\fdexit.96
  270.   wait! t i:\sbbs\fdevent.ok
  271.   del i:\sbbs\fdevent.ok > nul
  272.   call weekly.bat
  273.   rem > i:\sbbs\fdevent.ovr
  274.   goto FRT_DOOR
  275.  
  276. :WEEKLY1
  277.   rem > c:\fd\fd2\fdexit.55
  278.   goto FRT_DOOR
  279.  
  280. :NET_ONLY
  281. :NET_ECHO
  282. :ECHO_ONLY
  283.  
  284. REM Imail does it all
  285.  
  286.   imail scan
  287.   goto LOOPBACK
  288.  
  289. :XRSMAIL
  290.  
  291. REM XRS mail toss
  292.  
  293.   echo XRS Mail found
  294.   copy c:\sbbs\n1\xrs\*.pkt c:\fd\inbound > nul
  295.   del c:\sbbs\n1\xrs\*.pkt > nul
  296.  
  297. :UNPACK_MAIL
  298.  
  299. REM unack and toss mail
  300.  
  301.   imail toss
  302.   imthings import
  303.   if exist i:\sbbs\n?.up goto SKIP
  304.   import 20 c:\util\imailmbu.log
  305.   if errorlevel 20 mbutil link -clean
  306.  
  307. :SKIP
  308.   if not exist c:\fd\inbound\*.tic goto SKIP2
  309.   touch c:\fd\inbound\*.*
  310.   kdsdn111
  311.   tick >> c:\util\tick.log
  312.   if exist c:\fd\inbound\*.pkt imail toss
  313.  
  314. :SKIP2
  315.   rem > c:\fd\fd2\fdrescan.now
  316.   cd\util\dwarz
  317.   if exist c:\fd\inbound\dnet*.* dwarznet
  318.   cd\fd\fd1
  319.   goto FRT_DOOR
  320.  
  321. :MODEM_INIT
  322.   echo ~~~+++~~~ATH~~~ > COM1
  323.   be ask "Press A to abort FD startup! C to Continue." ca default=c timeout=9
  324.   if errorlevel 2 goto QUIT
  325.   goto FRT_DOOR
  326.  
  327. :FD_UP
  328.   cls
  329.   echo Node 1 of Frontdoor is allready running, check the windows...
  330.   echo Press ALT, then S to switch and see which windows are open.
  331.   echo If things don't look right and no one is on line 1 press ALT
  332.   echo then FX to run Fix Frontdoor nodes...
  333.   pause
  334.   exit
  335.  
  336. :QUIT
  337.   if exist i:\sbbs\n1.up del i:\sbbs\n1.up > nul
  338.   if exist i:\fd\fd1.up del i:\fd\fd1.up > nul
  339.   sbbsutil nodestatus 1 1
  340.   echo ATH1M0 > COM1
  341.   exit
  342.  
  343.